package com.yjhb.android.sbz.manager;

import android.content.Context;

import com.yjhb.android.sbz.App;
import com.yjhb.android.sbz.activity.MainActivity;
import com.yjhb.android.sbz.tool.EventMsg;
import com.yjhb.android.sbz.manager.im.IMManager;
import com.yjhb.android.sbz.tool.UserTool;
import com.jojo.android.zxlib.tool.ZxActivityTool;

import org.greenrobot.eventbus.EventBus;

/**
 * 创建者 zx
 * 创建时间 2020/12/25 16:03
 */
public class SysManager {
    private final String TAG = "SysManager";


    public static void exitLogin(Context context){
        clearUserInfo();
        ZxActivityTool.skipActivity(context, MainActivity.class);
    }

    public static void clearUserInfo(){
        UserTool.clearUserInfo();
        App.userInfo = null;
        IMManager.getInstance().logout();
        EventBus.getDefault().post(new EventMsg(EventMsg.USER_UPDATE_OK, null));
    }

}
